//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package 力扣.题库.未分类;

import java.util.HashSet;

public class demo_3396 {
    public demo_3396() {
    }

    public int minimumOperations(int[] nums) {
        HashSet<Integer> set = new HashSet();

        int i;
        for(i = nums.length - 1; i >= 0 && set.add(nums[i]); --i) {
        }

        ++i;
        if (i == 0) {
            return 0;
        } else {
            return i % 3 == 0 ? i / 3 : i / 3 + 1;
        }
    }
}
